// <editor-fold defaultstate="collapsed" desc="Đừng Quan tâm"> 
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package gui.vatnuoi;

import gui.event.vatnuoi.VNChiTietDlg_evt;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JButton;

/**
 *
 * @author nv_ca
 */
public class VNChiTiet_Dialog extends javax.swing.JDialog {

    /**
     * Creates new form KHChiTiet
     */
    private List<JButton> listButtons;

    public VNChiTiet_Dialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        this.setLocationRelativeTo(parent);
        listButtons = new ArrayList<JButton>();
//        listButtons.add(btnSua);
//        listButtons.add(btnChiTiet);

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlThongTinChiTietVatNuoi = new javax.swing.JPanel();
        lblTenChu = new javax.swing.JLabel();
        txtTenChu = new javax.swing.JTextField();
        lblMaVatNuoi = new javax.swing.JLabel();
        txtMaVatNuoi = new javax.swing.JTextField();
        lblTenVatNuoi = new javax.swing.JLabel();
        txtTenVatNuoi = new javax.swing.JTextField();
        lblDoTuoi = new javax.swing.JLabel();
        txtDoTuoi = new javax.swing.JTextField();
        lblGhiChu = new javax.swing.JLabel();
        lblCanNang = new javax.swing.JLabel();
        txtCanNang = new javax.swing.JTextField();
        lblChungLoai = new javax.swing.JLabel();
        lblGiong = new javax.swing.JLabel();
        txtChungLoai = new javax.swing.JTextField();
        txtGiong = new javax.swing.JTextField();
        jScrollPane2 = new javax.swing.JScrollPane();
        taGhiChu = new javax.swing.JTextArea();
        pnlBenhAnTiemChung = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblBenhAnTiemChung = new javax.swing.JTable();
        btnClose = new javax.swing.JButton();
        btnIn = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Thông tin chi tiết vật nuôi");

        pnlThongTinChiTietVatNuoi.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Thông tin chi tiết vật nuôi", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(0, 0, 204)));

        lblTenChu.setText("Tên chủ:");

        txtTenChu.setEditable(false);

        lblMaVatNuoi.setText("Mã vật nuôi:");

        txtMaVatNuoi.setEditable(false);
        txtMaVatNuoi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtMaVatNuoiActionPerformed(evt);
            }
        });

        lblTenVatNuoi.setText("Tên vật nuôi:");

        txtTenVatNuoi.setEditable(false);
        txtTenVatNuoi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtTenVatNuoiActionPerformed(evt);
            }
        });

        lblDoTuoi.setText("Độ tuổi (tháng):");

        txtDoTuoi.setEditable(false);

        lblGhiChu.setText("Ghi chú:");

        lblCanNang.setText("Cân nặng:");

        txtCanNang.setEditable(false);

        lblChungLoai.setText("Chủng loại:");

        lblGiong.setText("Giống (giới tính):");

        txtChungLoai.setEditable(false);

        txtGiong.setEditable(false);
        txtGiong.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtGiongActionPerformed(evt);
            }
        });

        taGhiChu.setEditable(false);
        taGhiChu.setColumns(20);
        taGhiChu.setRows(5);
        jScrollPane2.setViewportView(taGhiChu);

        javax.swing.GroupLayout pnlThongTinChiTietVatNuoiLayout = new javax.swing.GroupLayout(pnlThongTinChiTietVatNuoi);
        pnlThongTinChiTietVatNuoi.setLayout(pnlThongTinChiTietVatNuoiLayout);
        pnlThongTinChiTietVatNuoiLayout.setHorizontalGroup(
            pnlThongTinChiTietVatNuoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlThongTinChiTietVatNuoiLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlThongTinChiTietVatNuoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblTenVatNuoi)
                    .addComponent(lblTenChu)
                    .addComponent(lblMaVatNuoi)
                    .addComponent(lblChungLoai)
                    .addComponent(lblGiong))
                .addGap(19, 19, 19)
                .addGroup(pnlThongTinChiTietVatNuoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlThongTinChiTietVatNuoiLayout.createSequentialGroup()
                        .addGroup(pnlThongTinChiTietVatNuoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(txtMaVatNuoi, javax.swing.GroupLayout.DEFAULT_SIZE, 134, Short.MAX_VALUE)
                            .addComponent(txtTenChu)
                            .addComponent(txtTenVatNuoi))
                        .addGap(44, 44, 44)
                        .addGroup(pnlThongTinChiTietVatNuoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlThongTinChiTietVatNuoiLayout.createSequentialGroup()
                                .addComponent(lblGhiChu)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(pnlThongTinChiTietVatNuoiLayout.createSequentialGroup()
                                .addGroup(pnlThongTinChiTietVatNuoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lblDoTuoi)
                                    .addComponent(lblCanNang))
                                .addGap(39, 39, 39)
                                .addGroup(pnlThongTinChiTietVatNuoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtDoTuoi)
                                    .addComponent(txtCanNang)))))
                    .addGroup(pnlThongTinChiTietVatNuoiLayout.createSequentialGroup()
                        .addGroup(pnlThongTinChiTietVatNuoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtGiong, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtChungLoai, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        pnlThongTinChiTietVatNuoiLayout.setVerticalGroup(
            pnlThongTinChiTietVatNuoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlThongTinChiTietVatNuoiLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlThongTinChiTietVatNuoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblTenChu)
                    .addComponent(txtTenChu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblDoTuoi)
                    .addComponent(txtDoTuoi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlThongTinChiTietVatNuoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtMaVatNuoi, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(pnlThongTinChiTietVatNuoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblMaVatNuoi)
                        .addComponent(txtCanNang, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(lblCanNang)))
                .addGroup(pnlThongTinChiTietVatNuoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlThongTinChiTietVatNuoiLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(pnlThongTinChiTietVatNuoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblTenVatNuoi)
                            .addComponent(txtTenVatNuoi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblGhiChu))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(pnlThongTinChiTietVatNuoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblChungLoai)
                            .addComponent(txtChungLoai, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(pnlThongTinChiTietVatNuoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblGiong)
                            .addComponent(txtGiong, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlThongTinChiTietVatNuoiLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );

        pnlBenhAnTiemChung.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Bệnh án & tiêm chủng", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(0, 0, 204)));

        tblBenhAnTiemChung.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Mã bệnh án", "Tên bệnh án", "Mã tiêm chủng", "Loại"
            }
        ));
        tblBenhAnTiemChung.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        tblBenhAnTiemChung.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                tblBenhAnTiemChungFocusGained(evt);
            }
        });
        jScrollPane1.setViewportView(tblBenhAnTiemChung);

        javax.swing.GroupLayout pnlBenhAnTiemChungLayout = new javax.swing.GroupLayout(pnlBenhAnTiemChung);
        pnlBenhAnTiemChung.setLayout(pnlBenhAnTiemChungLayout);
        pnlBenhAnTiemChungLayout.setHorizontalGroup(
            pnlBenhAnTiemChungLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 579, Short.MAX_VALUE)
        );
        pnlBenhAnTiemChungLayout.setVerticalGroup(
            pnlBenhAnTiemChungLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlBenhAnTiemChungLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE))
        );

        btnClose.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/images/ultility/Close-16.png"))); // NOI18N
        btnClose.setText("Đóng");
        btnClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCloseActionPerformed(evt);
            }
        });

        btnIn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/images/ultility/Printer-16.png"))); // NOI18N
        btnIn.setText("In...");
        btnIn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnInActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pnlThongTinChiTietVatNuoi, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlBenhAnTiemChung, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(btnIn, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnClose, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlThongTinChiTietVatNuoi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(pnlBenhAnTiemChung, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnClose)
                    .addComponent(btnIn))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCloseActionPerformed
        VNChiTietDlg_evt.btnCloseActionPerformed(this);
    }//GEN-LAST:event_btnCloseActionPerformed

    private void tblBenhAnTiemChungFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_tblBenhAnTiemChungFocusGained
        VNChiTietDlg_evt.tblVatNuoiFocusGained(this.listButtons);
    }//GEN-LAST:event_tblBenhAnTiemChungFocusGained

    private void txtTenVatNuoiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtTenVatNuoiActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtTenVatNuoiActionPerformed

    private void txtMaVatNuoiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtMaVatNuoiActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtMaVatNuoiActionPerformed

    private void txtGiongActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtGiongActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtGiongActionPerformed

    private void btnInActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInActionPerformed
        VNChiTietDlg_evt.btnInActionPerformed(tblBenhAnTiemChung);
    }//GEN-LAST:event_btnInActionPerformed
// <editor-fold defaultstate="collapsed" desc="Đừng Quan tâm"> 

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(VNChiTiet_Dialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(VNChiTiet_Dialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(VNChiTiet_Dialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(VNChiTiet_Dialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the dialog */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                VNChiTiet_Dialog dialog = new VNChiTiet_Dialog(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnClose;
    private javax.swing.JButton btnIn;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JLabel lblCanNang;
    private javax.swing.JLabel lblChungLoai;
    private javax.swing.JLabel lblDoTuoi;
    private javax.swing.JLabel lblGhiChu;
    private javax.swing.JLabel lblGiong;
    private javax.swing.JLabel lblMaVatNuoi;
    private javax.swing.JLabel lblTenChu;
    private javax.swing.JLabel lblTenVatNuoi;
    private javax.swing.JPanel pnlBenhAnTiemChung;
    private javax.swing.JPanel pnlThongTinChiTietVatNuoi;
    private javax.swing.JTextArea taGhiChu;
    private javax.swing.JTable tblBenhAnTiemChung;
    private javax.swing.JTextField txtCanNang;
    private javax.swing.JTextField txtChungLoai;
    private javax.swing.JTextField txtDoTuoi;
    private javax.swing.JTextField txtGiong;
    private javax.swing.JTextField txtMaVatNuoi;
    private javax.swing.JTextField txtTenChu;
    private javax.swing.JTextField txtTenVatNuoi;
    // End of variables declaration//GEN-END:variables
//</editor-fold> 
}
